#pragma once
#include <string>
#include <vector>
#include <cocos2d.h>
class GameObject;

#include <ECS/Palette.h>

class LevelDef
{
public:
	std::vector<ECS::AssemblyDef*> objects;
};

class Level
{
public:
	Level();
	virtual ~Level();

	bool initWith(LevelDef* def);

	void initWorld(cocos2d::CCLayer* _layer);

	void addObject(GameObject* object);

	GameObject* getObject(const std::string& id) const;

	static Level* getCurrentLevel();
protected:
	std::vector<GameObject*> _objects;

	GameObject* createCrate(float x = 0, float y = 0);
	GameObject* createTree(float x = 0, float y = 0);
	GameObject* createPlatform();
	GameObject* createCharacter();
	GameObject* createLandscape();
	GameObject* createTank(int fraction, float x = 0, float y = 0);
	GameObject* createToolkit(float x, float y);
};